package com.smh.a03ConfigureFileDemo1;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

public class Test2 {
    public static void main(String[] args) throws IOException {

        Properties pro = new Properties();
        pro.put("asd", "123");
        pro.put("qwe", "123");
        pro.put("zxc", "123");
        pro.put("fgh", "123");

//        BufferedWriter bw = new BufferedWriter(new FileWriter("day28-code\\file\\configure\\configure.properties"));
//        Set<Map.Entry<Object, Object>> entries = pro.entrySet();
//        for (Map.Entry<Object, Object> entry : entries) {
//            bw.write(entry.getKey()+"="+entry.getValue());
//            bw.newLine();
//        }
//        bw.close();

        //特有方法
        FileOutputStream fos = new FileOutputStream("day28-code\\file\\configure\\configure.properties");
        //写入文件
        pro.store(fos, "test");//备注
        fos.close();

    }
}
